﻿using System.Diagnostics;
using Microsoft.SharePoint;

namespace SPWarmUp.Library.Web
{
    /// <summary>
    /// Contains the event receivers for the SPWarmUp Feature that register and unregister type mappings
    /// in SP Service Locator
    /// </summary>
    public class SpWarmUpFeatureReceiver : SPFeatureReceiver
    {
        public override void FeatureActivated(SPFeatureReceiverProperties properties)
        {
            var bootstrapper = new FeatureBootStrapper();
            Trace.TraceInformation("Entering Method 'Register Type Mappings'");
            bootstrapper.RegisterTypeMappings();
            Trace.TraceInformation("Leaving Method 'Register Type Mappings'");
            
        }

        public override void FeatureDeactivating(SPFeatureReceiverProperties properties)
        {
            Trace.TraceInformation("Entering Method 'Unregister application'");
            var bootstrapper = new FeatureBootStrapper();
            bootstrapper.UnregisterApplication();
            Trace.TraceInformation("Leaving Method 'Unregister application'");
        }
    }
}
